<?php

/**
 * SocialEnginePro
 *
 * @category   Application_Extensions
 * @package    
 * @author     Azim
 */

/**
 * @category   Application_Extensions
 * @package    
 */
class Tv_Widget_BrowseSearchController extends Engine_Content_Widget_Abstract {

    public function indexAction() {
        // Form
        $this->view->formFilter = $formFilter = new Tv_Form_Search();
        $defaultValues = $formFilter->getValues();



        $p = Zend_Controller_Front::getInstance()->getRequest()->getParams();

        // Populate form data
        if ($formFilter->isValid($p)) {
            $this->view->formValues = $values = $formFilter->getValues();
        } else {
            $formFilter->populate($defaultValues);
            $this->view->formValues = $values = array();
        }

        // Prepare data
        $this->view->formValues = $values = $formFilter->getValues();


        if (@$p['spec']) {
            $this->view->formValues = $values;
        }

        $formFilter->isValid($values);
    }

}
